using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;

namespace Tests
{
    [TestFixture]
    public class TestGeneratedConfig
    {
        [Test]
        public void TestCustomConfigSections()
        {
            WebGear.Utilities.ErrorReporterSection sec = WebGear.Utilities.Config.ErrorReporter;
            Assert.AreEqual("email@domain.com", sec.FromAddress);
            Assert.AreEqual("Error Reporter", sec.FromName);
            Assert.AreEqual("Error: {0}, {1}", sec.Subject);
            Assert.AreEqual("Error Flood", sec.FloodSubject);
            Assert.AreEqual("localhost", sec.Host);
            Assert.IsTrue(sec.Enabled);

            Assert.AreEqual(1, sec.Recipients.Count);
            Assert.AreEqual("Developer", sec.Recipients[0].Name);
            Assert.AreEqual("developer@domain.com", sec.Recipients[0].Email);
            Assert.AreEqual(0, sec.Recipients[0].AlertDelay);
            Assert.AreEqual(10, sec.Recipients[0].FloodDelay);
            Assert.AreEqual(3, sec.Recipients[0].FloodLimit);
        }
    }
}
